<?php


namespace app\backend\validate;


use think\Validate;

class InformationValidate extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'title' => 'require',
        'copyright' => 'require',
        'address' => 'require',
        'phone' => 'require',
        'number' => 'require',
        'sort' => 'require',
        'status' => 'require',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' =>  '错误信息'
     *
     * @var array
     */
    protected $message = [
        'title' => '请输入网站名称！',
        'copyright' => '请输入版权！',
        'address' => '请输入地址！',
        'phone' => '请输入手机号！',
        'number' => '请输入备案号！',
        'sort' => '请输入排序！',
        'status' => '请输入状态！',
    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'create' => ['title', 'copyright','address','phone','number','sort','status'],
        'update' => ['title', 'copyright','address','phone','number','sort','status']
    ];
}